class Dog{
    name: string;
    age: number;
    constructor(name:string,age:number){
        this.name = name;
        this.age = age;
    }
    speak(){
        return `${this.name} 汪汪汪!!!`
    }
}

let dog = new Dog('小黑',2)
console.log(dog.speak())